home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / QuickTime™ VR 2.0 SDK / QTVR C⁄C++ Runtime API / QuickTime™ VR API / CIncludes / QTVRFrmt.h < prev   
Encoding:
C/C++ Source or Header  |  1997-05-22  |  9.9 KB  |  377 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        QTVRFrmt.h
  3.  
  4.     Contains:    The QuickTime™ VR File Format Structures Public Header File version 2.0
  5.  
  6.     Written by:    The QuickTime™ VR Team
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #ifndef __QTVRFRMT__
  12. #define __QTVRFRMT__
  13.  
  14. #ifndef __MOVIES__
  15. #include <Movies.h>
  16. #endif
  17.  
  18. #ifndef __QTVR__
  19. #include <QTVR.h>
  20. #endif
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. #if PRAGMA_ALIGN_SUPPORTED
  27. #pragma options align=mac68k
  28. #endif
  29.  
  30. typedef float    Float32;        // IEEE 754 32-bit single format 
  31.  
  32. // File Format Version numbers
  33. #define kQTVRMajorVersion (2)
  34. #define kQTVRMinorVersion (0)
  35.  
  36. // User data type for the Movie Controller type specifier
  37. enum {    
  38.     kQTControllerType    = 'ctyp',    // Atom & ID of where our
  39.     kQTControllerID        = 1            // … controller name is stored
  40. };
  41.  
  42. // VRWorld atom types
  43. enum {
  44.     kQTVRWorldHeaderAtomType         = 'vrsc',
  45.     kQTVRImagingParentAtomType         = 'imgp',
  46.     kQTVRPanoImagingAtomType        = 'impn',
  47.     kQTVRObjectImagingAtomType        = 'imob',
  48.     kQTVRNodeParentAtomType            = 'vrnp',
  49.     kQTVRNodeIDAtomType                = 'vrni',
  50.     kQTVRNodeLocationAtomType        = 'nloc'
  51. };
  52.  
  53. // NodeInfo atom types
  54. enum {
  55.     kQTVRNodeHeaderAtomType            = 'ndhd',
  56.     kQTVRHotSpotParentAtomType        = 'hspa',
  57.     kQTVRHotSpotAtomType            = 'hots',
  58.     kQTVRHotSpotInfoAtomType        = 'hsin',
  59.     kQTVRLinkInfoAtomType            = 'link'
  60. };
  61.  
  62. // Miscellaneous atom types
  63. enum {
  64.     kQTVRStringAtomType                = 'vrsg',
  65.     kQTVRPanoSampleDataAtomType        = 'pdat',
  66.     kQTVRObjectInfoAtomType            = 'obji',
  67.     kQTVRAngleRangeAtomType            = 'arng',
  68.     kQTVRTrackRefArrayAtomType        = 'tref',
  69.     kQTVRPanConstraintAtomType        = 'pcon',
  70.     kQTVRTiltConstraintAtomType        = 'tcon',
  71.     kQTVRFOVConstraintAtomType        = 'fcon'
  72. };
  73.  
  74. // Track reference types
  75. enum {
  76.     kQTVRImageTrackRefType            = 'imgt',
  77.     kQTVRHotSpotTrackRefType        = 'hott'
  78. };
  79.  
  80. // Old hot spot types
  81. enum {
  82.     kQTVRHotSpotNavigableType        = 'navg'
  83. };
  84.  
  85. // Valid bits used in VRLinkHotSpotAtom
  86. enum {
  87.     kQTVRValidPan         = 1 << 0,
  88.     kQTVRValidTilt        = 1 << 1,
  89.     kQTVRValidFOV        = 1 << 2,
  90.     kQTVRValidViewCenter = 1 << 3
  91. };
  92.  
  93.  
  94. // Values for flags field in VRPanoSampleAtom
  95. enum {
  96.     kQTVRPanoFlagHorizontal = 1 << 0,
  97.     kQTVRPanoFlagLast        = 1 << 31
  98. };
  99.  
  100.  
  101. // Values for locationFlags field in VRNodeLocationAtom
  102. enum {
  103.     kQTVRSameFile = 0
  104. };
  105.  
  106.  
  107. // Header for QTVR track's Sample Description record (vrWorld atom container is appended)
  108. typedef struct QTVRSampleDescription {
  109.     UInt32    size;    // total size of the QTVRSampleDescription
  110.     UInt32    type;    // must be 'qtvr'
  111.  
  112.     UInt32    reserved1;        // must be zero
  113.     UInt16    reserved2;        // must be zero
  114.     UInt16    dataRefIndex;    // must be zero
  115.     
  116.     UInt32    data;            // Will be extended to hold vrWorld QTAtomContainer
  117.  
  118. }  QTVRSampleDescription, *QTVRSampleDescriptionPtr, **QTVRSampleDescriptionHandle;
  119.  
  120.  
  121. //=================================================================================================
  122. // Definitions and structures used in the VRWorld QTAtomContainer
  123. //-------------------------------------------------------------------------------------------------
  124.  
  125.  
  126. typedef struct VRStringAtom {
  127.     UInt16 stringUsage;
  128.     UInt16 stringLength;
  129.     
  130.     unsigned char string[4];
  131. } VRStringAtom, *VRStringAtomPtr;
  132.  
  133.  
  134. typedef struct VRWorldHeaderAtom {
  135.     UInt16 majorVersion;
  136.     UInt16 minorVersion;
  137.     
  138.     QTAtomID nameAtomID;
  139.     UInt32 defaultNodeID;
  140.     UInt32 vrWorldFlags;
  141.     
  142.     UInt32 reserved1;
  143.     UInt32 reserved2;
  144. } VRWorldHeaderAtom, *VRWorldHeaderAtomPtr;
  145.  
  146. // Valid bits used in VRPanoImagingAtom
  147. enum {
  148.     kQTVRValidCorrection         = 1 << 0,
  149.     kQTVRValidQuality            = 1 << 1,
  150.     kQTVRValidDirectDraw        = 1 << 2,
  151.     kQTVRValidFirstExtraProperty = 1 << 3
  152. };
  153.  
  154. typedef struct VRPanoImagingAtom {
  155.     UInt16 majorVersion;
  156.     UInt16 minorVersion;
  157.     
  158.     UInt32 imagingMode;
  159.     UInt32 imagingValidFlags;
  160.     
  161.     UInt32 correction;
  162.     UInt32 quality;
  163.     UInt32 directDraw;
  164.     UInt32 imagingProperties[6]; // for future properties
  165.  
  166.     UInt32 reserved1;
  167.     UInt32 reserved2;
  168. } VRPanoImagingAtom, *VRPanoImagingAtomPtr;
  169.  
  170. typedef struct VRNodeLocationAtom {
  171.     UInt16 majorVersion;
  172.     UInt16 minorVersion;
  173.     
  174.     OSType nodeType;
  175.     UInt32 locationFlags;
  176.     UInt32 locationData;
  177.  
  178.     UInt32 reserved1;
  179.     UInt32 reserved2;
  180. } VRNodeLocationAtom, *VRNodeLocationAtomPtr;
  181.  
  182.  
  183. //=================================================================================================
  184. // Definitions and structures used in the Nodeinfo QTAtomContainer
  185. //-------------------------------------------------------------------------------------------------
  186.  
  187. typedef struct VRNodeHeaderAtom {
  188.     UInt16 majorVersion;
  189.     UInt16 minorVersion;
  190.     
  191.     OSType nodeType;
  192.     QTAtomID    nodeID;
  193.     QTAtomID    nameAtomID;
  194.     QTAtomID    commentAtomID;    
  195.     
  196.     UInt32    reserved1;
  197.     UInt32    reserved2;
  198. } VRNodeHeaderAtom, *VRNodeHeaderAtomPtr;
  199.  
  200.  
  201. typedef struct VRAngleRangeAtom {
  202.     Float32    minimumAngle;
  203.     Float32    maximumAngle;
  204. } VRAngleRangeAtom, *VRAngleRangeAtomPtr;
  205.  
  206.  
  207. typedef struct VRHotSpotInfoAtom {
  208.     UInt16        majorVersion;
  209.     UInt16        minorVersion;
  210.     
  211.     OSType        hotSpotType;
  212.     QTAtomID    nameAtomID;
  213.     QTAtomID    commentAtomID;
  214.  
  215.     SInt32        cursorID [3];
  216.     
  217.     // canonical view for this hot spot
  218.     Float32        bestPan;
  219.     Float32        bestTilt;
  220.     Float32        bestFOV;
  221.     FloatPoint    bestViewCenter;
  222.     
  223.     // Bounding box for this hot spot
  224.     Rect        hotSpotRect;
  225.     
  226.     UInt32        flags;
  227.     UInt32        reserved1;
  228.     UInt32        reserved2;
  229. } VRHotSpotInfoAtom, *VRHotSpotInfoAtomPtr;
  230.  
  231.  
  232. typedef struct VRLinkHotSpotAtom {
  233.     UInt16        majorVersion;
  234.     UInt16        minorVersion;
  235.     
  236.     UInt32        toNodeID;
  237.     
  238.     UInt32        fromValidFlags;
  239.     Float32        fromPan;
  240.     Float32        fromTilt;
  241.     Float32        fromFOV;
  242.     FloatPoint    fromViewCenter;
  243.  
  244.     UInt32        toValidFlags;
  245.     Float32        toPan;
  246.     Float32        toTilt;
  247.     Float32        toFOV;
  248.     FloatPoint    toViewCenter;
  249.  
  250.     Float32        distance;
  251.  
  252.     UInt32        flags;
  253.     UInt32        reserved1;
  254.     UInt32        reserved2;
  255. } VRLinkHotSpotAtom, *VRLinkHotSpotAtomPtr;
  256.  
  257.  
  258. //=================================================================================================
  259. // Definitions and structures used in Panorama and Object tracks
  260. //-------------------------------------------------------------------------------------------------
  261.  
  262. typedef struct VRPanoSampleAtom {
  263.     UInt16    majorVersion;
  264.     UInt16    minorVersion;
  265.  
  266.     UInt32    imageRefTrackIndex;        // track reference index of the full res image track
  267.     UInt32    hotSpotRefTrackIndex;    // track reference index of the full res hot spot track
  268.     
  269.     Float32    minPan;
  270.     Float32    maxPan;
  271.     Float32    minTilt;
  272.     Float32    maxTilt;
  273.     Float32    minFieldOfView;
  274.     Float32    maxFieldOfView;
  275.  
  276.     Float32    defaultPan;
  277.     Float32    defaultTilt;
  278.     Float32    defaultFieldOfView;
  279.  
  280.     // Info for highest res version of image track
  281.     UInt32    imageSizeX;            // pixel width of the panorama (e.g. 768)
  282.     UInt32    imageSizeY;            // pixel height of the panorama (e.g. 2496)
  283.     UInt16    imageNumFramesX;    // diced frames wide (e.g. 1)
  284.     UInt16    imageNumFramesY;    // diced frames high (e.g. 24)
  285.     
  286.     // Info for highest res version of hotSpot track
  287.     UInt32    hotSpotSizeX;        // pixel width of the hot spot panorama (e.g. 768)
  288.     UInt32    hotSpotSizeY;        // pixel height of the hot spot panorama (e.g. 2496)
  289.     UInt16    hotSpotNumFramesX;  // diced frames wide (e.g. 1)
  290.     UInt16    hotSpotNumFramesY;    // diced frames high (e.g. 24)
  291.  
  292.     UInt32    flags;
  293.     UInt32    reserved1;
  294.     UInt32    reserved2;
  295.     
  296. } VRPanoSampleAtom, *VRPanoSampleAtomPtr;
  297.  
  298. typedef struct VRTrackRefEntry {
  299.     UInt32    trackRefType;
  300.     UInt16    trackResolution;
  301.     UInt32    trackRefIndex;
  302. } VRTrackRefEntry;
  303.  
  304. //=================================================================================================
  305. // Object File format 2.0
  306. //-------------------------------------------------------------------------------------------------
  307. enum QTVRPlaySettings {
  308.     kQTVRObjectAnimateViewFramesOn            = (1 << 0),                
  309.     kQTVRObjectPalindromeViewFramesOn        = (1 << 1),
  310.     kQTVRObjectStartFirstViewFrameOn        = (1 << 2),
  311.     kQTVRObjectAnimateViewsOn                = (1 << 3),
  312.     kQTVRObjectPalindromeViewsOn            = (1 << 4),
  313.     kQTVRObjectSyncViewToFrameRate            = (1 << 5), 
  314.     kQTVRObjectDontLoopViewFramesOn            = (1 << 6)
  315. };
  316.  
  317. enum QTVRViewSettings {
  318.     kQTVRObjectWrapPanOn                    = (1 << 0),        
  319.     kQTVRObjectWrapTiltOn                    = (1 << 1),        
  320.     kQTVRObjectCanZoomOn                    = (1 << 2),        
  321.     kQTVRObjectReverseHControlOn            = (1 << 3), 
  322.     kQTVRObjectReverseVControlOn            = (1 << 4), 
  323.     kQTVRObjectSwapHVControlOn                = (1 << 5),
  324.     kQTVRObjectTranslationOn                = (1 << 6)
  325. };
  326.  
  327. enum ObjectUITypes{
  328.     kGrabberScrollerUI        = 1,    // "Object" 
  329.     kOldJoyStickUI            = 2,    //  "1.0 Object as Scene"     
  330.     kJoystickUI                = 3,    // "Object In Scene"
  331.     kGrabberUI                = 4,    // "Grabber only"
  332.     kAbsoluteUI                = 5        // "Absolute pointer"
  333. };
  334.  
  335.  
  336. typedef struct VRObjectSampleAtom {
  337.     UInt16         majorVersion;        // kQTVRMajorVersion
  338.     UInt16        minorVersion;        // kQTVRMinorVersion
  339.     UInt16        movieType;            // ObjectUITypes
  340.     UInt16        viewStateCount;        // The number of view states 1 based
  341.     UInt16        defaultViewState;    // The default view state number. The number must be 1 to viewStateCount
  342.     UInt16        mouseDownViewState;    // The mouse down view state.   The number must be 1 to viewStateCount
  343.     UInt32        viewDuration;        // The duration of each view including all animation frames in a view
  344.     UInt32        columns;            // Number of columns in movie
  345.     UInt32        rows;                // Number rows in movie
  346.     Float32        mouseMotionScale;    // 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.
  347.     Float32        minPan;                // Start   horizontal pan angle in degrees
  348.     Float32        maxPan;                // End     horizontal pan angle in degrees
  349.     Float32        defaultPan;            // Initial horizontal pan angle in degrees (poster view)
  350.     Float32        minTilt;            // Start   vertical   pan angle in degrees
  351.     Float32        maxTilt;            // End     vertical   pan angle in degrees
  352.     Float32        defaultTilt;        // Initial vertical   pan angle in degrees (poster view)    
  353.     Float32        minFieldOfView;        // minimum field of view setting (appears as the maximum zoom effect) must be >= 1
  354.     Float32        fieldOfView;        // the field of view range must be >= 1
  355.     Float32        defaultFieldOfView; // must be in minFieldOfView and maxFieldOfView range inclusive
  356.     Float32        defaultViewCenterH; 
  357.     Float32        defaultViewCenterV;
  358.  
  359.     Float32        viewRate;             
  360.     Float32        frameRate;             
  361.     UInt32        animationSettings;        // 32 reserved bit fields
  362.     UInt32        controlSettings;        // 32 reserved bit fields
  363.  
  364. } VRObjectSampleAtom, *VRObjectSampleAtomPtr;
  365.  
  366.  
  367. #if PRAGMA_ALIGN_SUPPORTED
  368. #pragma options align=reset
  369. #endif
  370.  
  371. #ifdef __cplusplus
  372. }
  373. #endif
  374.  
  375. #endif // __QTVRFRMT__
  376.  
  377.